package com.agentworkflow.engine.core.enums;

import lombok.Getter;

@Getter
public enum NodeCategory {
    EVENT("event", "事件节点"),
    ACTION("action", "任务节点"),
    GATEWAY("gateway", "网关节点");
    private final String code;

    private final String description;

    NodeCategory(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public NodeCategory fromCode(String code) {
        for (NodeCategory nodeCategory : NodeCategory.values()) {
            if (nodeCategory.code.equals(code)) {
                return nodeCategory;
            }
        }
        return null;
    }
}
